/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package animacion;

import java.util.LinkedList;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import modelasimu.Servidor;

/**
 *
 * @author Javier Cifuentes M
 */
public class AnimarCosas {

    public JLabel entrada;
    public JLabel salida;
    public JLabel cola;
    public JPanel panel;
    public JSeparator separador;
    int normal = 64;
    int human = 40;
    int offset = (normal - human) / 2;
    public int xinicial, xfinal, yinicial, yfinal;

    public AnimarCosas(JLabel entrada, JLabel salida, JLabel cola, JPanel panel, JSeparator separador) {
        this.entrada = entrada;
        this.salida = salida;
        this.panel = panel;
        this.separador = separador;
        this.cola = cola;

    }

    public void deEntradaaCola() {
        xinicial = entrada.getX() + normal;
        yinicial = entrada.getY() + offset;
        xfinal = cola.getX() + offset;
        yfinal = cola.getY() - human;
    }

    public void deColaAServidor() {
        xinicial = cola.getX() + normal;
        yinicial = cola.getY() + offset;
        xfinal = (panel.getWidth() / 2) - (human / 2);
        yfinal = separador.getY() - human;


    }

    public void deServidoraSalida() {
        xinicial = (panel.getWidth() / 2) - (human / 2);
        yinicial = separador.getY() - human;
        xfinal = salida.getX() - human;
        yfinal = salida.getY() + offset;

    }

    public void deEntradaaSalida() {
        xinicial = entrada.getX() + normal;
        yinicial = entrada.getY() + offset;
        xfinal = salida.getX() - human;
        yfinal = salida.getY() + offset;
    }
}
